import config from '@/utils/config';
import { request } from '@/utils/http';
import { API } from '../model/baseModel';
import { LoginModel, LoginParamModel } from '../model/loginModel';

/**
 * 登录
 * @param params
 */
export function login(params: LoginParamModel) {
  return request.post<API<LoginModel>>(config.url.login, params);
}

/**
 * 登出
 */
export function logout() {
  return request.post<API>(config.url.logout, {});
}

/**
 * 刷新token
 */
export function refreshToken() {
  return request.post<API<LoginModel>>(config.url.refresh_token, {});
}
